<template>
    <div>
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>
                    <i class="el-icon-lx-cascades"></i> 订单列表
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            <el-table
                    :data="orderData"
                    border
                    class="table"
                    ref="multipleTable"
                    header-cell-class-name="table-header"
                    @selection-change="handleSelectionChange"
            >
                <!--                <el-table-column type="selection" width="55" align="center"></el-table-column>-->
                <el-table-column prop="Order_id" label="订单编号" width="100" align="center"></el-table-column>
                <el-table-column prop="Consumer_name" label="顾客姓名"></el-table-column>
                <el-table-column prop="Goods_name" label="商品名称"></el-table-column>
                <el-table-column prop="Order_date" label="订单日期"></el-table-column>
                <el-table-column prop="Trans_request" label="运输要求"></el-table-column>
                <el-table-column prop="Is_available" label="是否可供货"></el-table-column>
                <el-table-column prop="Trans_fare" label="运输费用"></el-table-column>
                <el-table-column prop="Ordgoods_number" label="商品数量"></el-table-column>
                <el-table-column prop="Order_sum_money" label="总金额"></el-table-column>
<!--                <el-table-column label="操作" width="180" align="center">-->
<!--                    <template #default="scope">-->
<!--                        <el-button-->
<!--                                type="primary"-->
<!--                                @click="handlebuyGoods(scope.row)"-->
<!--                        >购买</el-button>-->
<!--                    </template>-->
<!--                </el-table-column>-->
            </el-table>
        </div>

        <!-- 编辑弹出框 -->
<!--        <el-dialog title="购买" v-model="buyVisible" width="30%">-->
<!--            <el-form ref="form" :model="form" label-width="70px">-->
<!--                <el-form-item label="顾客ID">-->
<!--                    <el-input v-model="orderData.Consumer_id"></el-input>-->
<!--                </el-form-item>-->
<!--                <el-form-item label="运输要求">-->
<!--                    <el-input v-model="orderData.Trans_request"></el-input>-->
<!--                </el-form-item>-->
<!--            </el-form>-->
<!--            <template #footer>-->
<!--                <span class="dialog-footer">-->
<!--                    <el-button @click="buyVisible = false">取 消</el-button>-->
<!--                    <el-button type="primary" @click="buyGoods">确 定</el-button>-->
<!--                </span>-->
<!--            </template>-->
<!--        </el-dialog>-->
    </div>
</template>

<script>
    // import {fetchgoodsData} from "../api/index";
    import {fetchorderData} from "../api/index";
    export default {
        name: "goodsData",
        data() {
            return {
                orderData: [],
                query:{},
                multipleSelection: [],
                delList: [],
                buyVisible: false,
                pageTotal: 0,

                idx: -1,
                id: -1
            };
        },
        created() {
            this.getData()
        },
        methods: {

            getData(){
                fetchorderData().then(res =>{console.info(res)
                    this.orderData=res.data.value
                })
            },


            // 购买操作
            // handlebuyGoods(row){
            //     this.orderData = row;
            //     this.buyVisible = true;
            // },
            // 购买成功
            // buyGoods() {
            //     this.buyVisible = false;
            //     this.$message.success(`下单成功`);
            //     fetchBuyGoods(this.orderData).then(res =>{console.info(res)
            //         console.log(this.orderData)
            //     })
            // },
        }
    };
</script>

<style scoped>
    .handle-box {
        margin-bottom: 20px;
    }

    .handle-select {
        width: 120px;
    }

    .handle-input {
        width: 300px;
        display: inline-block;
    }
    .table {
        width: 100%;
        font-size: 14px;
    }
    .red {
        color: #ff0000;
    }
    .mr10 {
        margin-right: 10px;
    }
    .table-td-thumb {
        display: block;
        margin: auto;
        width: 40px;
        height: 40px;
    }
</style>
